package tank02;

import javax.swing.*;

public class MyGame extends JFrame {

    public static final int PANEL_WIDTH = 1000;
    public static final int PANEL_HEIGHT = 750;
    public static final int DIRECTION_UP = 0;
    public static final int DIRECTION_DOWN = 1;
    public static final int DIRECTION_LEFT = 2;
    public static final int DIRECTION_RIGHT = 3;

    private MyPanel panel;

    public MyGame(){
        panel = new MyPanel();
        //设置面板
        this.add(panel);
        //设置宽度和高度
        this.setSize(1000,750);
        //点击关闭后停止程序
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //设置可见
        this.setVisible(true);
        //设置键盘监听
        this.addKeyListener(panel);
    }

    public static void main(String[] args) {
        new MyGame();
    }
}